import convert.ConvertFactory;

import java.io.File;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Paths;

public class Main {

    public static void main(String[] args) throws Exception {
        try (OutputStream outputStream = Files.newOutputStream(Paths.get("C:\\Users\\Admin\\Desktop\\test.pdf"))) {
            ConvertFactory.toPdf(new File("C:\\Users\\Admin\\Desktop\\xxxx.docx"), outputStream);
        }
        try (OutputStream outputStream = Files.newOutputStream(Paths.get("C:\\Users\\Admin\\Desktop\\test.pdf"))) {
            ConvertFactory.toPdf(new File("C:\\Users\\Admin\\Desktop\\xxxx.pptx"), outputStream);
        }
        try (OutputStream outputStream = Files.newOutputStream(Paths.get("C:\\Users\\Admin\\Desktop\\test.pdf"))) {
            ConvertFactory.toPdf(new File("C:\\Users\\Admin\\Desktop\\xxxx.xlsx"), outputStream);
        }
        try (OutputStream outputStream = Files.newOutputStream(Paths.get("C:\\Users\\Admin\\Desktop\\test.pdf"))) {
            ConvertFactory.toPdf(new File("C:\\Users\\Admin\\Desktop\\xxxx.png"), outputStream);
        }
    }

}
